package com.yxw.live_vod_backend_boot.controller;

import com.yxw.live_vod_backend_boot.service.ShopBackendService;
import com.yxw.live_vod_facade.dto.ReviewExamineDTO;
import com.yxw.live_vod_facade.dto.ShopHomepageReviewQueryDTO;
import com.yxw.live_vod_facade.dto.ShopQueryDTO;
import com.yxw.live_vod_facade.vo.ShopHomePageVO;
import com.yxw.live_vod_facade.vo.UploadSourceMaterialReviewVO;
import com.yxw.yxnet_cd_center.common.dto.PageVO;
import com.yxw.yxnet_cd_center.common.utils.BaseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 店铺后台操作 Controller控制层
 *
 * @author xiexuxin
 * @date 2023-12-04
 */
@RestController
@Api(value = "店铺后台操作", tags = "店铺后台操作")
@Slf4j
@RequestMapping("/api/backend/shop")
public class ShopBackendController {

    @Autowired
    private ShopBackendService shopBackendService;

    @ApiOperation(value = "获取店铺列表(分页)")
    @PostMapping(value = "/get_shop_list")
    public BaseResult<PageVO<ShopHomePageVO>> getShopList(@RequestBody ShopQueryDTO dto){
        return shopBackendService.getShopList(dto);
    }

    @ApiOperation(value = "获取店铺详情")
    @PostMapping(value = "/get_shop_homepage")
    public BaseResult getShopById(@RequestParam("shopId") String shopId){
        return shopBackendService.getShopById(shopId);
    }

    @ApiOperation(value = "获取店铺的主页审核信息列表")
    @PostMapping(value = "/get_shop_homepage_review_list")
    public BaseResult<PageVO<UploadSourceMaterialReviewVO>> getShopHomePageReviewList(@RequestBody ShopHomepageReviewQueryDTO queryDTO){
        return shopBackendService.getShopHomePageReviewList(queryDTO);
    }

    @ApiOperation(value = "获取店铺审核信息详情")
    @PostMapping(value = "/get_shop_homepage_review_by_id")
    public BaseResult getShopHomePageReviewById(@RequestParam String materialId){
        return shopBackendService.getShopHomePageReviewById(materialId);
    }

    @ApiOperation(value = "店铺主页信息审核处理")
    @PostMapping(value = "/is_shop_homepage_review")
    public BaseResult isShopHomepageReview(@RequestBody ReviewExamineDTO reviewExamineDTO){
        return shopBackendService.isShopHomepageReview(reviewExamineDTO);
    }

    @ApiOperation(value = "获取店铺列表")
    @PostMapping(value = "/get_all")
    public BaseResult getAllShop(){
        return shopBackendService.getAllShop();
    }

    @ApiOperation(value = "根据店铺查询直播间中被拉黑用户列表")
    @PostMapping(value = "/get_banned_user_list_by_shop")
    public BaseResult getBannedUserListByShop(@RequestParam("shopId") String shopId){
        return shopBackendService.getBannedUserListByShop(shopId);
    }
}
